]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
environment: Be more careful when hooking up style properties
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 24 Apr 2014 14:20:01 +0000 (16:20 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 24 Apr 2014 17:31:55 +0000 (19:31 +0200)
Sometimes it is more appropriate to set layout properties that are
hooked up to CSS properties in code. However this is currently not
possible, as we end up setting properties to 0 when not found in CSS;
be a bit more careful when hooking up CSS properties to support this.

https://bugzilla.gnome.org/show_bug.cgi?id=728897

js/ui/environment.js

index cb286d5bd6ee39b78b42bd18131423bea7a3e582..3144ec68669207c8274227d14b9096c03947117a 100644 (file)
@@ -47,8 +47,11 @@ function _patchLayoutClass(layoutClass, styleProps) {
         layoutClass.prototype.hookup_style = function(container) {
             container.connect('style-changed', Lang.bind(this, function() {
                 let node = container.get_theme_node();
-                for (let prop in styleProps)
-                    this[prop] = node.get_length(styleProps[prop]);
+                for (let prop in styleProps) {
+                    let [found, length] = node.lookup_length(styleProps[prop], false);
+                    if (found)
+                        this[prop] = length;
+                }
             }));
         };
     layoutClass.prototype.child_set = function(actor, props) {